<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="/struts-bean" prefix="bean"%>
<%@ taglib uri="/struts-html" prefix="html"%>
<%@ taglib uri="/struts-logic" prefix="logic"%>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>欢迎来到龙岗区政府主办公益性职介所</title>
		<link href="/css/style.css" rel="stylesheet" type="text/css" />
	</head>
	<script type="text/javascript" src="/js/prototype-1.5.1.2.js"
		charset="UTF-8"></script>
	<script type="text/javascript">
//检查用户名是否存在
function checkLoginName(){
        var lname = document.all.loginName.value;
        if(lname=="" || lname.length<0){
        alert("\u5bf9\u4e0d\u8d77\uff0c\u7528\u6237\u540d\u4e0d\u80fd\u4e3a\u7a7a\uff01");
        document.all.loginName.value="";
        document.all.loginName.focus();
        }else{
    	var url = '/com/checkloginname.do';
        var pars = 'lname='+lname;
     
        var myAjax = new Ajax.Updater({success:'checkloginname'}, url, {method: 'get', parameters: pars});
        }
    	}
    //检查密码
	function checkPwd()
	{
		if (document.all.password.value != document.all.repassword.value){
			alert('\u5bf9\u4e0d\u8d77\uff0c\u4e24\u6b21\u8f93\u5165\u7684\u5bc6\u7801\u4e0d\u4e00\u81f4\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\uff01');
			document.all.password.value = "";
			document.all.repassword.value ="";
			document.all.password.focus();
		}
	}

//必填项
 function doMethod()
 {
    if(document.all.loginName.value==""){
    alert("对不起,用户名不能为空!");
    return false;
    }
    if(document.all.password.value==""){
    alert("对不起,密码不能为空!");
    return false;
    }
    if(document.all.email.value==""){
    alert("对不起,邮箱不能为空!");
    return false;
    }
    if(document.all.question.value==""){
    alert("对不起,问题不能为空!");
    return false;
    }
    if(document.all.answer.value==""){
    alert("对不起,问题答案不能为空!");
    return false;
    }
    
    document.forms[0].submit();
 }
 
 function reset(){
 document.forms[0].reset();
 }
</script>
	<body>
	<html:form action="/com/struts/web/user/register/reglogin">
		<table width="880" border="0" align="center" cellpadding="0"
			cellspacing="0">
			<%@ include file="/jsp/top.jsp"%>
			<tr>
				<td align="center" valign="top">
					<table width="880" border="0" cellpadding="0" cellspacing="8"
						bgcolor="#FFFFFF">
						<tr>
							<td colspan="2" align="center" valign="top">
								<img src="/images/index_34.gif" width="721" height="54" />
							</td>
						</tr>
						<tr>
							<td colspan="2" align="center" valign="top">
								（说明：带 “
								<span class="red"> * </span>” 号的为必填项）
							</td>
						</tr>
						<tr>
							<td colspan="2" align="center" valign="top">
								<table width="80%" cellpadding="0" cellspacing="1"
									bgcolor="#CCCCCC">
									<tr>
										<td width="14%" align="right" bgcolor="#f7f7f7">
											<span class="red">*</span>用 户 名：
										</td>
										<td width="31%" height="60" align="left" bgcolor="#f7f7f7">
											<html:text property="loginName" styleId="loginName" onblur="checkLoginName()"/><div id="checkloginname"></div>
										</td>
										<td width="55%" align="left" bgcolor="#f7f7f7">
											(英文字母、数字或下划线，6至80个字符，不区分大小写。为避免用户名重复，建议用Email作用户名。)
										</td>
									</tr>
									<tr>
										<td height="60" align="right" bgcolor="#FFFFFF">
											<span class="red">*</span>电子邮件：
										</td>
										<td align="left" bgcolor="#FFFFFF">
											<html:text property="email"/>
										</td>
										<td align="left" bgcolor="#FFFFFF">
											(请准确填写您的E-MAIL地址。E-MAIL是您接收您审核帐号的唯一工具，也是您享受求职服务的重要工具，包括：接收公司邀请面试通知，接收本网服务通知等信息。)
										</td>
									</tr>
									<tr>
										<td align="right" bgcolor="#f7f7f7" height="30">
											<span class="red">*</span>密    码：
										</td>
										<td align="left" bgcolor="#f7f7f7">
											 <html:password property="password"/>
										</td>
										<td align="left" bgcolor="#f7f7f7">
											(请输入英文字母、数字或下划线，长度为6~20个字符 )
										</td>
									</tr>
									<tr>
										<td height="30" align="right" bgcolor="#FFFFFF">
											<span class="red">*</span>密码确认：
										</td>
										<td align="left" bgcolor="#FFFFFF">
											<input type="password" onblur="checkPwd()" id="repassword"/>
										</td>
										<td align="left" bgcolor="#FFFFFF">
											(请再次输入密码。)
										</td>
									</tr>
									<tr>
										<td align="right" bgcolor="#f7f7f7">
											<span class="red">*</span>密码保护问题：
										</td>
										<td align="left" bgcolor="#f7f7f7">
											<html:text property="question"/>
										</td>
										<td align="left" bgcolor="#f7f7f7">
											(请记住密码保护问题，万一密码遗失可根据此问题获取新密码。)
										</td>
									</tr>
									<tr>
										<td height="30" align="right" bgcolor="#FFFFFF">
											<span class="red">*</span>密码保护答案：
										</td>
										<td align="left" bgcolor="#FFFFFF">
											 <html:text property="answer"/>
										</td>
										<td align="left" bgcolor="#FFFFFF">
											(请记住密码保护答案，万一密码遗失可根据此答案获取新密码。)
										</td>
									</tr>
								</table>
							</td>
						</tr>
						<tr>
							<td width="50%" align="right" valign="top">
								<img src="/images/reg1.gif" width="94" height="28" style="cursor:hand" onclick="doMethod()"/>
							</td>
							<td align="left" valign="top">
								<img src="/images/reg2.gif" width="63" height="28" style="cursor:hand" onclick="reset()"/>
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<%@ include file="/jsp/bottom.jsp" %>
		</table>
		</html:form>
	</body>
</html>
